import request from "../utils/request";

//获取优惠券列表
export function getCouponList(data) {
  return request({
    method: "post",
    url: "/api/Coupon/Find",
    data
  });
}

//获取组合项目
export function getCommodityList(params) {
  return request({
    method: "get",
    url: "/api/PCApplet/GetCommodityList_Coupon",
    params
  });
}

//根据id获取优惠券详情
export function getCouponById(params) {
  return request({
    method: "get",
    url: "/api/Coupon/Get",
    params
  });
}

//修改优惠券
export function createCoupon(data) {
  return request({
    method: "post",
    url: "/api/Coupon/Create",
    data
  });
}

//编辑优惠券
export function updateCoupon(data) {
  return request({
    method: "post",
    url: "/api/Coupon/Update",
    data
  });
}

//删除优惠券
export function delectCoupon(data) {
  return request({
    method: "post",
    url: "/api/Coupon/Delete",
    data
  });
}

//修改状态
export function setCouponState(data) {
  return request({
    method: "post",
    url: "/api/Coupon/SetState",
    data
  });
}

//赠送优惠券
export function giveUserCoupon(data) {
  return request({
    method: "post",
    url: "/api/CouponPerson/Give",
    data
  });
}
